package com.consult.controller;

import com.consult.config.dto.AjaxResult;
import com.consult.entity.Admin;
import com.consult.service.IAdminService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author ${author}
 * @since 2021-06-22
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Resource
    private IAdminService adminService;

    @PostMapping("/register")
    public AjaxResult register(@RequestBody Admin admin) {
        adminService.save(admin);
        return AjaxResult.success();
    }

}

